<html>
<script>
	
</script>
<head>
<link type="text/css" rel="styleSheet" href="css/root.css" />
<link type="text/css" rel="styleSheet" href="css/css.css" />
<script src="js/vue-cookies.js"></script>
<script src="js/jquery-3.5.1.js"></script>
</head>
<body>
<div id="top">
	<div id="topCenter">
		<span class="nav"><a onclick="index()">首页</a></span> 
		<span class="nav"><a onclick="fucos()">板块</a></span>
		<span class="nav"><a onclick="add()">发帖</a></span> 
		<span id="denglu">
		<span class="tag"><a href="/login">登录</a></span>
		<span class="tag"><a onclick="newUser()">注册</a></span>
		</span>
		<span id="tuichudenglu">
		<span class="tag"><a href="/logout">退出登录</a></span>
		<span class="tag"><a onclick="" id="username">消息</a></span>
		</span>
	</div>
</div>
			
			<iframe src="rootpage/articlelist.html" id="center" frameborder="0" scrolling="no" allowtransparency="no"></iframe>
			
			<div id="right">
				<div class="button" onclick="myarticle()">我的帖子</div>
				<div class="button" onclick="mycomment()">我的评论</div>
				<div class="button" onclick="myfavorite()">我的收藏</div>
				<div class="button">我的好友</div>
				<div class="button">个人中心</div>
				<div class="button">关于</div>
			</div>

</body>
<script>
var userid=0;
//检测登录信息
$.ajax({
	url:"/getusername",
	type:"get",
	success:function(resp){
		if(resp!="anonymousUser"){
		denglu.style="display:none";
		tuichudenglu.style="";
		$.ajax({
			url:"/getuserid/"+resp,
			type:"get",
			success:function(response){
				if(response!=0){
					userid=response;
					window.$cookies.set("userid",userid);
				}
			}
		});
		username.innerText=resp;}
		else{
			denglu.style="";tuichudenglu.style="display:none";
		}
	}
});
//页面切换
function index(){center.src="rootpage/articlelist.html"}
function fucos(){center.src="3.html"}
function add(){center.src="addarticle.html"}
function myarticle(){center.src="myarticle.html"}
function myfavorite(){center.src="myfavorite.html"}
function mycomment(){center.src="mycomment.html"}
</script>
</html>
